
R version 3.1.0 (2014-04-10) -- "Spring Dance"
Copyright (C) 2014 The R Foundation for Statistical Computing
Platform: x86_64-unknown-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> set.seed(51)
> 
> load(file="~/PM10/pm10_withps1990.Rda")
> 
> ######## Prune observations that are out of range ###########
> dat=subset(dat, outofrange==0)
> dat$pscat = as.factor(dat$pscat)
> 
> ######## Set the Working Directory so that output is saved in the right place ######## 
> wd <- "~/PM10/20150502_pollution_big_1990/"
> setwd(wd)
> 
> ##############################################################
> ################ Specify the Array Parameters ################
> ##############################################################
> ytrans = c("log", "change", "95") 
> 
> ##############################################################
> ###################### Array Starts Here #####################
> ##############################################################
> j = as.numeric(Sys.getenv('SLURM_ARRAY_TASK_ID'))
> print(j)
[1] 1
> 
> 
> library(splines)
> library(HEIfunctions)
> library(coda)
Loading required package: lattice
> library(corpcor)
> 
> ######## Choose how to transform pollution ######## 
> if (ytrans[j]=="log")
+   dat$y = log(dat$pm10fu)   
> if (ytrans[j]=="change")
+   dat$y = dat$pm10fu - dat$pm10base1990
> if (ytrans[j]=="95")
+   dat$y = log(dat$pm10fu95)
> 
> 
> 
> ######## Choose how to specify the model ######## 
> ### Big Models ###
> vars = c("Monitor", "a", "Median_income", "HS_rate", "Urban_rate", "Migration_5_year_rate", "Hispanic_cens", "White_cens", "Black_cens",
+          "Current_Smoking_rate_weighted", "Female_cens", "mean_age.2001", "Female_rate.2001", "White_rate.2001", "Black_rate.2001",
+          "Tot_Beneficiary.2001", "pm10base1990", "housedens", "temperature", "logpop")
> ## Use all the variables listed above except the census ones that are duplciated in medicare
> my=glm(y~pscat + pm10base1990 + Tot_Beneficiary.2001 + Median_income + HS_rate + Urban_rate + Migration_5_year_rate + Current_Smoking_rate_weighted + mean_age.2001 + Female_rate.2001 + White_rate.2001 + Black_rate.2001 + housedens + temperature + logpop, 
+        data=dat)
> formula = my$formula
> 
> coords 	<- cbind(dat$Longitude, dat$Latitude)
> 
> phistart 	<- makephi(coords, 10)
> philower 	<- makephi(coords, 4)
> phiupper 	<- makephi(coords, 30)
> 
> tuning 	<- list(A = 0.1, psi = 0.2, theta = 1)
> prior 		<- list(KIG = rep(.5,2), psi = rep(.5,2), theta1 = rep(philower, 2), theta2 = rep(phiupper,2))
> starting 	<- list(B=NULL, A = NULL, psi = NULL, theta = phistart)
> 
> mod 		<- mvpsmod(formula, dat, "a", coords, nsamp=50000, thin=1,
+ 			tuning=tuning, prior=prior, starting=starting, 
+       outputbinsize = 500, outputfilename = paste("pollutionmodel_temp_", ytrans[j],".Rda", sep=""))
Loading required package: spBayes
Loading required package: magic
Loading required package: abind
Loading required package: Formula
Loading required package: MASS
[1] "Note: function does not accept missing data in covariates."
[1] "Iteration: 1000"
[1] "Accepted:" "0.293"     "0.306"     "0.293"     "0.306"     "0.293"    
[7] "0.306"    
[1] "Number of not PD:" "0"                
[1] "Iteration: 2000"
[1] "Accepted:" "0.292"     "0.295"     "0.292"     "0.295"     "0.292"    
[7] "0.295"    
[1] "Number of not PD:" "0"                
[1] "Iteration: 3000"
[1] "Accepted:" "0.295"     "0.304"     "0.295"     "0.304"     "0.295"    
[7] "0.304"    
[1] "Number of not PD:" "0"                
[1] "Iteration: 4000"
[1] "Accepted:" "0.296"     "0.3"       "0.296"     "0.3"       "0.296"    
[7] "0.3"      
[1] "Number of not PD:" "0"                
[1] "Iteration: 5000"
[1] "Accepted:" "0.303"     "0.295"     "0.303"     "0.295"     "0.303"    
[7] "0.295"    
[1] "Number of not PD:" "0"                
[1] "Iteration: 6000"
[1] "Accepted:" "0.303"     "0.298"     "0.303"     "0.298"     "0.303"    
[7] "0.298"    
[1] "Number of not PD:" "0"                
[1] "Iteration: 7000"
[1] "Accepted:" "0.301"     "0.299"     "0.301"     "0.299"     "0.301"    
[7] "0.299"    
[1] "Number of not PD:" "0"                
[1] "Iteration: 8000"
[1] "Accepted:" "0.298"     "0.3"       "0.298"     "0.3"       "0.298"    
[7] "0.3"      
[1] "Number of not PD:" "0"                
[1] "Iteration: 9000"
[1] "Accepted:" "0.299"     "0.299"     "0.299"     "0.299"     "0.299"    
[7] "0.299"    
[1] "Number of not PD:" "0"                
[1] "Iteration: 10000"
[1] "Accepted:" "0.299"     "0.3"       "0.299"     "0.3"       "0.299"    
[7] "0.3"      
[1] "Number of not PD:" "0"                
[1] "Iteration: 11000"
[1] "Accepted:" "0.299"     "0.3"       "0.299"     "0.3"       "0.299"    
[7] "0.3"      
[1] "Number of not PD:" "0"                
[1] "Iteration: 12000"
[1] "Accepted:" "0.301"     "0.302"     "0.301"     "0.302"     "0.301"    
[7] "0.302"    
[1] "Number of not PD:" "0"                
[1] "Iteration: 13000"
[1] "Accepted:" "0.301"     "0.305"     "0.301"     "0.305"     "0.301"    
[7] "0.305"    
[1] "Number of not PD:" "0"                
[1] "Iteration: 14000"
[1] "Accepted:" "0.301"     "0.304"     "0.301"     "0.304"     "0.301"    
[7] "0.304"    
[1] "Number of not PD:" "0"                
[1] "Iteration: 15000"
[1] "Accepted:" "0.301"     "0.304"     "0.301"     "0.304"     "0.301"    
[7] "0.304"    
[1] "Number of not PD:" "0"                
[1] "Iteration: 16000"
[1] "Accepted:" "0.301"     "0.303"     "0.301"     "0.303"     "0.301"    
[7] "0.303"    
[1] "Number of not PD:" "0"                
[1] "Iteration: 17000"
[1] "Accepted:" "0.302"     "0.304"     "0.302"     "0.304"     "0.302"    
[7] "0.304"    
[1] "Number of not PD:" "0"                
[1] "Iteration: 18000"
[1] "Accepted:" "0.303"     "0.304"     "0.303"     "0.304"     "0.303"    
[7] "0.304"    
[1] "Number of not PD:" "0"                
[1] "Iteration: 19000"
[1] "Accepted:" "0.301"     "0.306"     "0.301"     "0.306"     "0.301"    
[7] "0.306"    
[1] "Number of not PD:" "0"                
[1] "Iteration: 20000"
[1] "Accepted:" "0.3"       "0.307"     "0.3"       "0.307"     "0.3"      
[7] "0.307"    
[1] "Number of not PD:" "0"                
[1] "Iteration: 21000"
[1] "Accepted:" "0.3"       "0.307"     "0.3"       "0.307"     "0.3"      
[7] "0.307"    
[1] "Number of not PD:" "0"                
[1] "Iteration: 22000"
[1] "Accepted:" "0.3"       "0.307"     "0.3"       "0.307"     "0.3"      
[7] "0.307"    
[1] "Number of not PD:" "0"                
[1] "Iteration: 23000"
[1] "Accepted:" "0.3"       "0.307"     "0.3"       "0.307"     "0.3"      
[7] "0.307"    
[1] "Number of not PD:" "0"                
[1] "Iteration: 24000"
[1] "Accepted:" "0.301"     "0.306"     "0.301"     "0.306"     "0.301"    
[7] "0.306"    
[1] "Number of not PD:" "0"                
[1] "Iteration: 25000"
[1] "Accepted:" "0.303"     "0.307"     "0.303"     "0.307"     "0.303"    
[7] "0.307"    
[1] "Number of not PD:" "0"                
[1] "Iteration: 26000"
[1] "Accepted:" "0.302"     "0.307"     "0.302"     "0.307"     "0.302"    
[7] "0.307"    
[1] "Number of not PD:" "0"                
[1] "Iteration: 27000"
[1] "Accepted:" "0.301"     "0.306"     "0.301"     "0.306"     "0.301"    
[7] "0.306"    
[1] "Number of not PD:" "0"                
[1] "Iteration: 28000"
[1] "Accepted:" "0.302"     "0.306"     "0.302"     "0.306"     "0.302"    
[7] "0.306"    
[1] "Number of not PD:" "0"                
[1] "Iteration: 29000"
[1] "Accepted:" "0.301"     "0.305"     "0.301"     "0.305"     "0.301"    
[7] "0.305"    
[1] "Number of not PD:" "0"                
[1] "Iteration: 30000"
[1] "Accepted:" "0.303"     "0.305"     "0.303"     "0.305"     "0.303"    
[7] "0.305"    
[1] "Number of not PD:" "0"                
[1] "Iteration: 31000"
[1] "Accepted:" "0.302"     "0.305"     "0.302"     "0.305"     "0.302"    
[7] "0.305"    
[1] "Number of not PD:" "0"                
[1] "Iteration: 32000"
[1] "Accepted:" "0.302"     "0.305"     "0.302"     "0.305"     "0.302"    
[7] "0.305"    
[1] "Number of not PD:" "0"                
[1] "Iteration: 33000"
[1] "Accepted:" "0.301"     "0.305"     "0.301"     "0.305"     "0.301"    
[7] "0.305"    
[1] "Number of not PD:" "0"                
[1] "Iteration: 34000"
[1] "Accepted:" "0.3"       "0.305"     "0.3"       "0.305"     "0.3"      
[7] "0.305"    
[1] "Number of not PD:" "0"                
[1] "Iteration: 35000"
[1] "Accepted:" "0.301"     "0.306"     "0.301"     "0.306"     "0.301"    
[7] "0.306"    
[1] "Number of not PD:" "0"                
[1] "Iteration: 36000"
[1] "Accepted:" "0.301"     "0.306"     "0.301"     "0.306"     "0.301"    
[7] "0.306"    
[1] "Number of not PD:" "0"                
[1] "Iteration: 37000"
[1] "Accepted:" "0.302"     "0.305"     "0.302"     "0.305"     "0.302"    
[7] "0.305"    
[1] "Number of not PD:" "0"                
[1] "Iteration: 38000"
[1] "Accepted:" "0.301"     "0.306"     "0.301"     "0.306"     "0.301"    
[7] "0.306"    
[1] "Number of not PD:" "0"                
[1] "Iteration: 39000"
[1] "Accepted:" "0.301"     "0.306"     "0.301"     "0.306"     "0.301"    
[7] "0.306"    
[1] "Number of not PD:" "0"                
[1] "Iteration: 40000"
[1] "Accepted:" "0.301"     "0.306"     "0.301"     "0.306"     "0.301"    
[7] "0.306"    
[1] "Number of not PD:" "0"                
[1] "Iteration: 41000"
[1] "Accepted:" "0.3"       "0.306"     "0.3"       "0.306"     "0.3"      
[7] "0.306"    
[1] "Number of not PD:" "0"                
[1] "Iteration: 42000"
[1] "Accepted:" "0.3"       "0.306"     "0.3"       "0.306"     "0.3"      
[7] "0.306"    
[1] "Number of not PD:" "0"                
[1] "Iteration: 43000"
[1] "Accepted:" "0.3"       "0.305"     "0.3"       "0.305"     "0.3"      
[7] "0.305"    
[1] "Number of not PD:" "0"                
[1] "Iteration: 44000"
[1] "Accepted:" "0.299"     "0.306"     "0.299"     "0.306"     "0.299"    
[7] "0.306"    
[1] "Number of not PD:" "0"                
[1] "Iteration: 45000"
[1] "Accepted:" "0.299"     "0.306"     "0.299"     "0.306"     "0.299"    
[7] "0.306"    
[1] "Number of not PD:" "0"                
[1] "Iteration: 46000"
[1] "Accepted:" "0.299"     "0.305"     "0.299"     "0.305"     "0.299"    
[7] "0.305"    
[1] "Number of not PD:" "0"                
[1] "Iteration: 47000"
[1] "Accepted:" "0.3"       "0.305"     "0.3"       "0.305"     "0.3"      
[7] "0.305"    
[1] "Number of not PD:" "0"                
[1] "Iteration: 48000"
[1] "Accepted:" "0.299"     "0.305"     "0.299"     "0.305"     "0.299"    
[7] "0.305"    
[1] "Number of not PD:" "0"                
[1] "Iteration: 49000"
[1] "Accepted:" "0.299"     "0.304"     "0.299"     "0.304"     "0.299"    
[7] "0.304"    
[1] "Number of not PD:" "0"                
[1] "Iteration: 50000"
[1] "Accepted:" "0.299"     "0.305"     "0.299"     "0.305"     "0.299"    
[7] "0.305"    
[1] "Number of not PD:" "0"                
> 
> save(mod, file = paste("pollutionmod_", ytrans[j], ".Rda", sep=""))
> 
> 
> 
> 
> 
> 
> proc.time()
     user    system   elapsed 
265743.59     57.26 266596.70 
